﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor"%>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<h2>ProducSend</h2>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HEAD" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="main_content" runat="server">
 <!--Bắt đầu fastFeedback Wrap gửi yêu cầu mua hàng-->
         <div>
            <div><h3>Send your message to this supplier</h3></div>
            <div>
            <%
                string hinhAnh = (string)ViewData["hinhAnh"];
                string maSP = (string)ViewData["maSP"];
                string link = "/Product/ProductDetail/" + maSP;
                string tenSP = (string)ViewData["tenSP"];
                string email = (string)ViewData["email"];
                string hotenNCC = (string)ViewData["hoTen"];
            %>

          

            <form onsubmit=" return false" action="/Product/SendEmailContact/<%=hinhAnh %>/<%=maSP %>" method="post">
                <table>
                    <tr>
                        <th>from:</th>
                        <td><input type="text" name="emailNguoiGui" id="emailNguoiGui" /></td>
                    </tr>

                    <tr>
                        <th>To:</th>
                        <td>
                            <div><input type="text" name="emailNguoiNhan" value="<%=email %>"/><br />
                            Supplier: <b><%=hotenNCC %></b><br />
                            Product : <a href="<%= link%>"><b><%=tenSP %></b></a>      
                        </td>
                    </tr>

                    <tr>
                        <th>Subject: </th>
                        <td><input type="text" name="chuDe" value="I would like to know more about your product" /></td>
                    </tr>

                    <tr>
                        <th>Message: </th>
                        <td><textarea class="ckeditor" id="editor1" rows="5" cols="15" name="noiDung"></textarea>
                        <script type="text/javascript">
                            function thongbao() {
                                var a = CKEDITOR.instances.editor1.getData()
                                alert(a);
                            }
                             
                            function checkEmail() {
                               
                                var email = document.getElementById('emailNguoiGui');
                                var filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
                                if (!filter.test(email.value)) {
                                alert('Vui long nhap email hop le');
                                email.focus;
                                return false;
                            }
           
                        </script>

                        
                        </td>
                    </tr>
                    <tr>
                        <th>Quantity Needed:</th>
                        <td><input type="text" /> <input type="text" /></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                            <input type="submit" value="Send"/>
                        </td>
                    </tr>

                </table>
            </form>
            </div>
         </div>
         <!--Kết thúc fastFeedbackWrap gửi yêu cầu mua hàng-->
</asp:Content>
